<?php
	/*****************************************************************
		GP Clinic - a web based Medical directory system
		Copyright (C) 2014 Kaizensynergy - Gemba360

		Author: Bless Bauson
		Key: bHkTy89wZ0DHyUiim0041rTxyBbP671aQwg327UtjfcrO
	*****************************************************************/
	
	$add = fetchAddFormParameters();

	//search filter submit
	$obj = new HealthFundType();
	if($_SERVER['REQUEST_METHOD'] == "POST"){
		if(isset($_POST['inactive']) && $_POST['inactive'] == 1){
			$obj->filter = "health_fund_type.active <= 1";
		}else{
			$obj->filter = "health_fund_type.active = 1";
		}

		if(isset($_POST['keyword']) && !empty($_POST['keyword'])){
			$obj->SQL_AddFilter("health_fund_type.label LIKE '%".$_POST['keyword']."%'");
		}
	}

	//view all using pagination
	$sql 		= $obj->SQL_FormQuery();
	$cntrows	= $obj->SQL_Count();

	//form pagination
	$rowcntPerPage  = CONST_PAGE_ROW_COUNT;
	$healthObj = new Pagination(
				$sql,				//query resultset
				$rowcntPerPage,		//max # of rows displayed
				'page',				//pagination variable used in GET or POST
				5					//number of links displayed in getPageNav
			);
?>